#/bin/sh

JH=/usr/java/latest/bin
PKG1=ru.teleology.cubefs.api.reflection
PKG2=ru.teleology.cubefs.api.reflection.metadata
PKG3=ru.teleology.cubefs.api.models

${JH}/javah -classpath bin -o native/natives.h \
    ${PKG1}.Type \
    ${PKG1}.Typed \
    ${PKG1}.TypeSystem \
    ${PKG1}.Types \
    ${PKG1}.TypedListBase \
    ${PKG1}.ListOfTypedBase \
    ${PKG1}.ScalarList \
    ${PKG1}.Factory \
    ${PKG1}.Number \
    ${PKG1}.TypedNumber \
    ${PKG1}.StringValue \
    ${PKG1}.StringRef \
    ${PKG1}.Operation \
    ${PKG1}.Parameter \
    ${PKG1}.IDValue \
    ${PKG2}.BitmapField \
    ${PKG2}.NumberField \
    ${PKG2}.IDField \
    ${PKG3}.Page \
    ${PKG3}.InputStreamAdaptor \
    ${PKG3}.OutputStreamAdaptor \
    ${PKG3}.AbstractJavaLogHandler \
    ${PKG3}.Iterator \
    ${PKG3}.Map



rm -rf dist
mkdir dist

make -C native/build
cp native/build/*.so dist

${JH}/jar -cf dist/cubefs-core.jar -C bin .


